package com.peng.crm.commons.exception;

/**
 * 自定义异常类  -->继承运行期异常
 */
public class CustomException extends RuntimeException{
    /**
     * 状态
     */
    private int code;
    /**
     * 异常提示信息
     */
    private String message;

    public CustomException() {
    }

    public CustomException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "CustomException{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
